package com.wenhao.tencent;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

/**
 * @author Wenhao Tong
 * @create 2021-08-22 20:44
 */
public class Main3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int T = scanner.nextInt();
        for (int i = 0;i < T;i++) {
            int n = scanner.nextInt();
            int w = scanner.nextInt();
            List<Integer> odd = new ArrayList<>();
            List<Integer> even = new ArrayList<>();
            for (int j = 0;j < n;j++) {
                int temp = scanner.nextInt();
                if (temp % 2 == 1) {
                    odd.add(temp);
                } else {
                    even.add(temp);
                }
            }

            int result = 0;

            int left = 0;
            int right = odd.size() - 1;
            odd.sort((x,y) -> x - y);
            while (left < right) {
                if (odd.get(left) + odd.get(right) <= w) {
                    left++;
                }
                right--;
                result++;
            }
            if (left == right) {
                result++;
            }
            left = 0;
            right = even.size() - 1;
            even.sort((x,y) -> x - y);
            while (left < right) {
                if (even.get(left) + even.get(right) <= w) {
                    left++;
                }
                right--;
                result++;
            }
            if (left == right) {
                result++;
            }
            System.out.println(result);
        }
    }
}
